home *** CD-ROM | disk | FTP | other *** search
/ The 640 MEG Shareware Studio 2 / The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO / clang / wndwc20.zip / WNDWREF.DOC < prev   
Text File  |  1989-03-06  |  101KB  |  2,053 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14.  
  15.  
  16.  
  17.  
  18.  
  19.  
  20.                            MULTI-LEVEL VIRTUAL WINDOWS
  21.                                  REFERENCE GUIDE
  22.  
  23.                                   Version 2.0
  24.                                 February 1, 1989
  25.  
  26.  
  27.                Copyright (C) 1988-1989 Eagle Performance Software
  28.                               All Rights Reserved.
  29.  
  30.  
  31.  
  32.                                _______
  33.                           ____|__     |               (tm)
  34.                        --|       |    |-------------------
  35.                          |   ____|__  |  Association of
  36.                          |  |       |_|  Shareware
  37.                          |__|   o   |    Professionals
  38.                        -----|   |   |---------------------
  39.                             |___|___|    MEMBER
  40.    WNDWC Multi-level Virtual Windows              Reference Guide, Version 2.0
  41.  
  42.  
  43.  
  44.                        T A B L E   O F   C O N T E N T S
  45.  
  46.         1. INTRODUCTION  . . . . . . . . . . . . . . . . . . . . . 4
  47.              Purpose . . . . . . . . . . . . . . . . . . . . . . . 4
  48.              Common Parameters . . . . . . . . . . . . . . . . . . 4
  49.              Attributes  . . . . . . . . . . . . . . . . . . . . . 5
  50.  
  51.         2. FUNCTIONS . . . . . . . . . . . . . . . . . . . . . . . 6
  52.              accesswindow  . . . . . . . . . . . . . . . . . . . . 6
  53.              changeborder  . . . . . . . . . . . . . . . . . . . . 6
  54.              getlevelindex . . . . . . . . . . . . . . . . . . . . 6
  55.              heapok  . . . . . . . . . . . . . . . . . . . . . . . 7
  56.              hidewindow  . . . . . . . . . . . . . . . . . . . . . 7
  57.              initwindow  . . . . . . . . . . . . . . . . . . . . . 7
  58.              locatecursor  . . . . . . . . . . . . . . . . . . . . 7
  59.              makewindow  . . . . . . . . . . . . . . . . . . . . . 8
  60.              move16  . . . . . . . . . . . . . . . . . . . . . . . 8
  61.              movewindow  . . . . . . . . . . . . . . . . . . . . . 8
  62.              movewords . . . . . . . . . . . . . . . . . . . . . . 9
  63.              removewindow  . . . . . . . . . . . . . . . . . . . . 9
  64.              restoreborder . . . . . . . . . . . . . . . . . . . . 9
  65.              restoretcwindow . . . . . . . . . . . . . . . . . . . 10
  66.              setcursordefault  . . . . . . . . . . . . . . . . . . 10
  67.              setvirtualsize  . . . . . . . . . . . . . . . . . . . 10
  68.              setwindowmodes  . . . . . . . . . . . . . . . . . . . 11
  69.              showwindow  . . . . . . . . . . . . . . . . . . . . . 11
  70.              titlewindow . . . . . . . . . . . . . . . . . . . . . 12
  71.              vresizewindow . . . . . . . . . . . . . . . . . . . . 12
  72.              vscrollview . . . . . . . . . . . . . . . . . . . . . 12
  73.              vupdatecursor . . . . . . . . . . . . . . . . . . . . 12
  74.              vupdaterows . . . . . . . . . . . . . . . . . . . . . 13
  75.              vupdatetitles . . . . . . . . . . . . . . . . . . . . 13
  76.              vupdateview . . . . . . . . . . . . . . . . . . . . . 13
  77.              vupdatewindow . . . . . . . . . . . . . . . . . . . . 13
  78.              vviewrc . . . . . . . . . . . . . . . . . . . . . . . 14
  79.              vviewrcrel  . . . . . . . . . . . . . . . . . . . . . 14
  80.              vzoomwindow . . . . . . . . . . . . . . . . . . . . . 14
  81.              weosc . . . . . . . . . . . . . . . . . . . . . . . . 14
  82.              weosln  . . . . . . . . . . . . . . . . . . . . . . . 15
  83.              weostorc  . . . . . . . . . . . . . . . . . . . . . . 15
  84.              weosr . . . . . . . . . . . . . . . . . . . . . . . . 15
  85.              wbrdrh  . . . . . . . . . . . . . . . . . . . . . . . 15
  86.              wbrdrpart . . . . . . . . . . . . . . . . . . . . . . 16
  87.              wbrdrv  . . . . . . . . . . . . . . . . . . . . . . . 16
  88.              wclreol . . . . . . . . . . . . . . . . . . . . . . . 16
  89.              wclreos . . . . . . . . . . . . . . . . . . . . . . . 17
  90.              wclrfield . . . . . . . . . . . . . . . . . . . . . . 17
  91.              wclrfieldeos  . . . . . . . . . . . . . . . . . . . . 17
  92.              wclrline  . . . . . . . . . . . . . . . . . . . . . . 17
  93.              wclrscr . . . . . . . . . . . . . . . . . . . . . . . 18
  94.              wclrtitle . . . . . . . . . . . . . . . . . . . . . . 18
  95.              wdelline  . . . . . . . . . . . . . . . . . . . . . . 18
  96.              wgotoeos  . . . . . . . . . . . . . . . . . . . . . . 18
  97.              wgotorc . . . . . . . . . . . . . . . . . . . . . . . 19
  98.  
  99.  
  100.                                        2
  101.    WNDWC Multi-level Virtual Windows              Reference Guide, Version 2.0
  102.  
  103.  
  104.              winsline  . . . . . . . . . . . . . . . . . . . . . . 19
  105.              wlineh  . . . . . . . . . . . . . . . . . . . . . . . 19
  106.              wlinepart . . . . . . . . . . . . . . . . . . . . . . 20
  107.              wlinev  . . . . . . . . . . . . . . . . . . . . . . . 20
  108.              writeandviewpage  . . . . . . . . . . . . . . . . . . 20
  109.              writetocrt  . . . . . . . . . . . . . . . . . . . . . 21
  110.              writetohidden . . . . . . . . . . . . . . . . . . . . 21
  111.              writetopage . . . . . . . . . . . . . . . . . . . . . 21
  112.              writetovirtual  . . . . . . . . . . . . . . . . . . . 21
  113.              wscrolldown . . . . . . . . . . . . . . . . . . . . . 22
  114.              wscrollup . . . . . . . . . . . . . . . . . . . . . . 22
  115.              wwherec . . . . . . . . . . . . . . . . . . . . . . . 22
  116.              wwherer . . . . . . . . . . . . . . . . . . . . . . . 22
  117.              wwrite  . . . . . . . . . . . . . . . . . . . . . . . 23
  118.              wwritec . . . . . . . . . . . . . . . . . . . . . . . 23
  119.              wwrite_sub  . . . . . . . . . . . . . . . . . . . . . 24
  120.  
  121.         3. DATA STRUCTURE  . . . . . . . . . . . . . . . . . . . . 25
  122.              Basic Types . . . . . . . . . . . . . . . . . . . . . 25
  123.              Macros  . . . . . . . . . . . . . . . . . . . . . . . 27
  124.              Static Variables  . . . . . . . . . . . . . . . . . . 28
  125.              Dynamic Variables . . . . . . . . . . . . . . . . . . 31
  126.  
  127.         APPENDIX A:  MEMORY ALLOCATION . . . . . . . . . . . . . . 32
  128.              Global Memory . . . . . . . . . . . . . . . . . . . . 32
  129.              Dynamic Memory  . . . . . . . . . . . . . . . . . . . 32
  130.              Code Size . . . . . . . . . . . . . . . . . . . . . . 33
  131.  
  132.         APPENDIX B:  ERROR MESSAGES  . . . . . . . . . . . . . . . 34
  133.  
  134.  
  135.  
  136.  
  137.  
  138.  
  139.  
  140.  
  141.  
  142.  
  143.  
  144.  
  145.  
  146.  
  147.  
  148.  
  149.  
  150.  
  151.  
  152.  
  153.  
  154.  
  155.  
  156.  
  157.  
  158.  
  159.  
  160.  
  161.                                        3
  162.    WNDWC Multi-level Virtual Windows              Reference Guide, Version 2.0
  163.  
  164.  
  165.    1.  I N T R O D U C T I O N
  166.  
  167.  
  168.    PURPOSE
  169.  
  170.    This document is a technical reference manual describing each routine and
  171.    variable in detail in a format similar to the TC manual.  The routines are
  172.    described in alphabetical order.  Since this manual is on disk, you can
  173.    find your interest easily with any search utility.
  174.  
  175.    Application - Because WNDWC uses QWIKC, all routines will perform in the
  176.    following applications:
  177.  
  178.      . All video text modes - 0, 1, 2, 3 and 7.
  179.      . Any column mode - 40, 80, or variable.
  180.      . For IBM PC, XT, AT, PCjr, PC convertible, all PS/2 models, 3270 PC, and
  181.        compatibles.
  182.      . With MDA, CGA, EGA, MCGA, VGA, 8214/A, all Hercules video cards.
  183.      . Perform routines in both absolute and window-relative coordinates.
  184.  
  185.  
  186.    COMMON PARAMETERS
  187.  
  188.    Common Parameters - Most procedures use the same parameters.  Rather than
  189.    repeating them for each routine, detailed descriptions for those parameters
  190.    are listed below.
  191.  
  192.    Window Coordinates - Unless otherwise stated, all WNDWC routines work in
  193.    window-relative coordinates.  For simplicity, virtual routines check for
  194.    bounds to keep routines confined to the windows and screen.  However, to be
  195.    fast, some other routines indicated in this document do not check for
  196.    bounds in the windows or on the screen, so be sure to stay in range.  The
  197.    upper left column in a window is row 1, column 1, which is also called a
  198.    1-based coordinate system.
  199.  
  200.    row/col - row and col were chosen in lieu of the X/Y scheme used in TC.
  201.    Since WNDWC is for only text modes, the screen is treated like a word
  202.    processor with rows and columns.  It is more intuitive to use the X/Y
  203.    scheme in graphics and the row/col scheme for text.
  204.  
  205.    rows/cols - Using rows/cols is much easier than row2/col2 to describe the
  206.    height and width of a block such as:
  207.  
  208.       void makewindow( row, col, rows, cols, wattr, battr, border, name );
  209.  
  210.    Should you decide to move the window, only row and col need to be changed,
  211.    and therefore rows and cols don't need to be mentally recalculated and
  212.    altered.  Please keep cols limited to one row.
  213.  
  214.    numofrows/numofcols - These parameters indicate a relative shift from a
  215.    given point that can be positive or negative.
  216.  
  217.    astr - The window-relative writing routines wwrite and wwritec actually use
  218.    QWIKC to write this string.
  219.  
  220.  
  221.  
  222.    Chapter 1, Introduction                                             Page 4
  223.    WNDWC Multi-level Virtual Windows              Reference Guide, Version 2.0
  224.  
  225.  
  226.  
  227.    ATTRIBUTES
  228.  
  229.    *attr - Use the convenient attribute macros for the foreground and
  230.    background colors supplied in the QWIKC unit rather than having to use TC
  231.    functions or procedures to get a desired color, for example:
  232.  
  233.      makewindow( 1, 1, 8, 8, WHITE+BLUE_BG, YELLOW+BLUE_BG, SINGLE_BORDER,
  234.                  AWINDOW );
  235.  
  236.    will make a window with a white on blue window and yellow on blue border.
  237.    All subsequent routines will use these attributes for writing.  Turbo C's
  238.    textattr function is called, setting the attribute to the window attribute
  239.    in case TC's screen functions are used.  The foreground macros in QWIKC are
  240.    duplicates of those in conio.h and are repeated here for convenience:
  241.  
  242.      BLACK         0x00       DARKGRAY      0x08
  243.      BLUE          0x01       LIGHTBLUE     0x09
  244.      GREEN         0x02       LIGHTGREEN    0x0A
  245.      CYAN          0x03       LIGHTCYAN     0x0B
  246.      RED           0x04       LIGHTRED      0x0C
  247.      MAGENTA       0x05       LIGHTMAGENTA  0x0D
  248.      BROWN         0x06       YELLOW        0x0E
  249.      LIGHTGRAY     0x07       WHITE         0x0F
  250.      BLINK         0x80
  251.  
  252.    In addition, the QWIKC background color constants were included to take
  253.    advantage of macro addition.
  254.  
  255.      BLACK_BG     0x00
  256.      BLUE_BG      0x10
  257.      GREEN_BG     0x20
  258.      CYAN_BG      0x30
  259.      RED_BG       0x40
  260.      MAGENTA_BG   0x50
  261.      BROWN_BG     0x60
  262.      LIGHTGRAY_BG 0x70
  263.      SAMEATTR     -1
  264.  
  265.    SAMEATTR - A powerful and unique feature of all WNDWC routines is the use
  266.    of the macro SAMEATTR.  If SAMEATTR, or a negative value, is used as an
  267.    attribute, the routine will suppress any changes to the attributes and use
  268.    what is currently on the screen.
  269.  
  270.  
  271.  
  272.  
  273.  
  274.  
  275.  
  276.  
  277.  
  278.  
  279.  
  280.  
  281.  
  282.  
  283.    Chapter 1, Introduction                                             Page 5
  284.    WNDWC Multi-level Virtual Windows              Reference Guide, Version 2.0
  285.  
  286.  
  287.    2.  F U N C T I O N S
  288.  
  289.    In this section, a detailed description is provided for each function.
  290.  
  291.  
  292.    ---------------------------------------------------------------------------
  293.    accesswindow                                                          WNDWC
  294.    ---------------------------------------------------------------------------
  295.    Function       Randomly accesses a covered window and places it on the top.
  296.                   If the window is hidden, it uses showwindow to put it on
  297.                   top.
  298.    Syntax         void accesswindow( int windowname );
  299.    Remarks        All underlays are properly updated in the heap with a high
  300.                   speed technique.  If NOACCESSMODE has been set for this
  301.                   window or an invalid window name is used, the function is
  302.                   simply ignored.  Virtual windows are updated after being
  303.                   shown.  Zoom effect is optional.  The wndwstat array is
  304.                   shuffled to match the new levels.
  305.    Return value   None.
  306.    Screens        All video pages.
  307.    EOS            Restored to new window.
  308.    Restrictions   Shadows are permitted, but exposed corners on lower level
  309.                   windows with shadows will not be updated until moved.  For
  310.                   human factors, shadows are only recommended for the top
  311.                   window anyway.
  312.    Heap           Temporarily uses (underlay size * 1.5).
  313.    Upon return    Forced to write to CRT.
  314.    See also       hidewindow, showwindow
  315.  
  316.    ---------------------------------------------------------------------------
  317.    changeborder                                                          WNDWC
  318.    ---------------------------------------------------------------------------
  319.    Function       Changes the border to a new border style.
  320.    Syntax         void changeborder( int newbrdr );
  321.    Remarks        The original border style is already saved in viewbrdr.  The
  322.                   current border is changed by searching for a match of wsbrdr
  323.                   for each border part with the current attribute.  If a match
  324.                   is found, it is replaced with newbrdr.  Tees as well as
  325.                   virtual borders are also replaced.  The original border can
  326.                   later be restored with restoreborder.
  327.    Return value   None.
  328.    Screens        All video pages.
  329.    EOS            Restored to CRT.
  330.    Restrictions   NO_BORDER is ignored as either the original or new border.
  331.    Upon return    Forced to write to CRT.
  332.    See also       restoreborder
  333.  
  334.    ---------------------------------------------------------------------------
  335.    getlevelindex                                                         WNDWC
  336.    ---------------------------------------------------------------------------
  337.    Function       Returns the wndwstat index given the windowname.
  338.    Syntax         int getlevelindex( int windowname );
  339.    Remarks        This routine scans for the first matching windowname.  It
  340.                   scans from the top level index (li) first and then down.
  341.                   Hidden windows from the hidden level index (hli) up are
  342.  
  343.  
  344.    Chapter 2, Procedures and Functions                                 Page 6
  345.    WNDWC Multi-level Virtual Windows              Reference Guide, Version 2.0
  346.  
  347.  
  348.                   scanned last.  If no match is found, the result is
  349.                   >MAXWINDOW.
  350.    Return value   None.
  351.  
  352.    ---------------------------------------------------------------------------
  353.    heapok                                                                WNDWC
  354.    ---------------------------------------------------------------------------
  355.    Function       Returns 1 if enough far heap space is available for
  356.                   allocation using farmalloc or farcalloc.
  357.    Syntax         void heapok( int numofbytes );
  358.    Remarks        If there is insufficient heap, the program terminates by
  359.                   calling showgoof.  The error window will display coreleft
  360.                   and farcoreleft.  All WNDWC functions that use the heap call
  361.                   this routine.
  362.    Return value   Returns 1 on success, calls showgoof on failure.
  363.  
  364.    ---------------------------------------------------------------------------
  365.    hidewindow                                                            WNDWC
  366.    ---------------------------------------------------------------------------
  367.    Function       Hides the current top window on the CRT.
  368.    Syntax         void hidewindow(void);
  369.    Remarks        The window is saved in RAM and the underlay is restored on
  370.                   the screen showing the new top window.  If NOHIDEMODE has
  371.                   been set for this window, the procedure is ignored.  The
  372.                   windows are saved with the border, but without any shadow.
  373.    Return value   None.
  374.    Screens        All video pages.
  375.    EOS            Altered to (wrow,wcol) before hiding, then restored to the
  376.                   new top window.
  377.    Heap           Temporarily uses (underlay size * 1.5).
  378.    Upon return    Forced to write to CRT.
  379.    See also       showwindow
  380.  
  381.    ---------------------------------------------------------------------------
  382.    initwindow                                                            WNDWC
  383.    ---------------------------------------------------------------------------
  384.    Function       Initializes static data for WNDWC routines.  In brief, it
  385.                   sets the defaults for wndwstat, indexes and margins for each
  386.                   video page, and calls qinit.
  387.    Syntax         void initwindow( int wattr, int clearscr, char cursorok );
  388.    Remarks        This is the first routine required to be called early in the
  389.                   main program and only needs to be done once.  wattr is the
  390.                   attribute for the full screen (WINDOW0) for all video pages.
  391.                   If clearscr is 1, then all video pages are cleared with
  392.                   wattr.  Over 50 variables are initialized with this
  393.                   function.  qinit is also called.  See initwindow source code
  394.                   for details.
  395.    Return value   None.
  396.    EOS            Set to (1,1).
  397.    Heap           Allocates virtualstat and pagestat pointers as required.
  398.    See also       setcursordefault, WNDWC20.DOC and Data Structure section.
  399.  
  400.    ---------------------------------------------------------------------------
  401.    locatecursor                                                          WNDWC
  402.    ---------------------------------------------------------------------------
  403.  
  404.  
  405.    Chapter 2, Procedures and Functions                                 Page 7
  406.    WNDWC Multi-level Virtual Windows              Reference Guide, Version 2.0
  407.  
  408.  
  409.    Function       Locates the cursor within the window.
  410.    Syntax         void locatecursor(void);
  411.    Remarks        This routine, a subroutine of restoretcwindow, locates the
  412.                   cursor as set in the wndwstat for fixed or virtual windows.
  413.                   It is usually handled automatically, but is available for
  414.                   handling exceptions.  vupdatecursor is called by
  415.                   locatecursor.
  416.    Return value   None.
  417.    Screens        All video pages.
  418.    See also       restoretcwindow, vupdatecursor
  419.  
  420.    ---------------------------------------------------------------------------
  421.    makewindow                                                            WNDWC
  422.    ---------------------------------------------------------------------------
  423.    Function       Makes a window.
  424.    Syntax         void makewindow( unsigned char row, unsigned char col,
  425.                                    unsigned char rows, unsigned char cols,
  426.                                    int wattr, int battr, int brdrsel,
  427.                                    int windowname );
  428.    Remarks        This is the main routine to create windows.  row, col, rows,
  429.                   and cols are the absolute coordinates for the window
  430.                   inclusive of any border.  For RELMODE, (row,col) is window
  431.                   relative.  wattr and battr are the window and border
  432.                   attributes, respectively (SAMEATTR is permitted).  brdrsel
  433.                   is the selection of one of 15 different borders.  windowname
  434.                   is a unique window name required for random access.  EOS set
  435.                   to (1,1).
  436.    Return value   None.
  437.    Screens        All video pages.
  438.    Restrictions   Minimum size - (1x1) without borders, (3x3) with borders.
  439.    Heap           Allocates underlay size until removed.
  440.    See also       setwindowmodes, removewindow
  441.  
  442.    ---------------------------------------------------------------------------
  443.    move16                                                                WNDWC
  444.    ---------------------------------------------------------------------------
  445.    Function       Copies a specified number of contiguous bytes from a source
  446.                   range to a destination range.
  447.    Syntax         void move16( void far *source, void far *dest,
  448.                                int numofbytes );
  449.    Remarks        move16 is a suitable replacement for memcpy, and is faster
  450.                   since it uses 16-bit transfers.  Overlap of data space is
  451.                   allowed.
  452.    Return value   None.
  453.    See also       movewords
  454.  
  455.    ---------------------------------------------------------------------------
  456.    movewindow                                                            WNDWC
  457.    ---------------------------------------------------------------------------
  458.    Function       Moves the current top window on the CRT a relative number of
  459.                   rows and columns.
  460.    Syntax         void movewindow( int numofrows, int numofcols );
  461.    Remarks        If NOMOVEMODE or PERMMODE has been set for this window, the
  462.                   function does nothing.  Shadows are fully supported.
  463.                   Margins are respected.
  464.  
  465.  
  466.    Chapter 2, Procedures and Functions                                 Page 8
  467.    WNDWC Multi-level Virtual Windows              Reference Guide, Version 2.0
  468.  
  469.  
  470.    Return value   None.
  471.    Screens        All video pages.
  472.    EOS            Moved relatively to the same place.
  473.    Heap           Maximum requirement is full screen size plus the underlay
  474.                   size.
  475.    Upon return    Forced to write to CRT.
  476.    See also       showwindow
  477.  
  478.    ---------------------------------------------------------------------------
  479.    movewords                                                             WNDWC
  480.    ---------------------------------------------------------------------------
  481.    Function       Copies a specified number of contiguous bytes from a source
  482.                   range to a destination range.
  483.    Syntax         void movewords( int far *source, int far *dest,
  484.                                   int numofwords );
  485.    Remarks        Even faster than move16.
  486.    Return value   None.
  487.    Restrictions   source[0] and dest must not overlap.
  488.    See also       move16
  489.  
  490.    ---------------------------------------------------------------------------
  491.    removewindow                                                          WNDWC
  492.    ---------------------------------------------------------------------------
  493.    Function       Removes the current top window on the CRT.
  494.    Syntax         void removewindow(void);
  495.    Remarks        Basically, the top window is removed restoring the underlay
  496.                   and then erased from memory.  Depending on the window mode,
  497.                   removewindow responds differently:
  498.  
  499.                     RELMODE     - The window-relative stats are simply
  500.                                   replaced with the parent window stats.
  501.                     PERMMODE    - The stats are simply dropped from the stack.
  502.                     VIRTUALMODE - The virtual screen is additionally removed
  503.                                   from the heap.
  504.  
  505.    Return value   None.
  506.    Screens        All video pages.
  507.    EOS            Restored to the new top window.
  508.    Heap           Deallocates the underlay.
  509.    Upon return    Forced to write to CRT.
  510.    See also       makewindow
  511.  
  512.    ---------------------------------------------------------------------------
  513.    restoreborder                                                         WNDWC
  514.    ---------------------------------------------------------------------------
  515.    Function       Restores the border to the original border style.
  516.    Syntax         void restoreborder(void);
  517.    Remarks        Reverses the effect of changeborder by replacing the current
  518.                   border style back to the original.
  519.    Return value   None.
  520.    Screens        All video pages.
  521.    EOS            Restored to CRT.
  522.    Upon return    Forced to write to CRT.
  523.    See also       changeborder
  524.  
  525.  
  526.  
  527.    Chapter 2, Procedures and Functions                                 Page 9
  528.    WNDWC Multi-level Virtual Windows              Reference Guide, Version 2.0
  529.  
  530.  
  531.    ---------------------------------------------------------------------------
  532.    restoretcwindow                                                       WNDWC
  533.    ---------------------------------------------------------------------------
  534.    Function       Restores attributes, cursor, and EOS marker for the current
  535.                   window.
  536.    Syntax         void restoretcwindow(void);
  537.    Remarks        Usually this procedure is handled automatically.  If there
  538.                   is some exception in handling, then this procedure can be
  539.                   used.  It does the following:
  540.  
  541.                     . Resets TC's textattr and QWIKC's scroll_attr to
  542.                       tws.origattr
  543.                     . Restores TC's text window
  544.                     . Resets EOS marker to last saved location
  545.                     . Resets cursor mode
  546.                     . Locates cursor with locatecursor
  547.  
  548.    Return value   None.
  549.    Screens        All video pages.
  550.    EOS            Restored.
  551.    See also       locatecursor
  552.  
  553.    ---------------------------------------------------------------------------
  554.    setcursordefault                                                      WNDWC
  555.    ---------------------------------------------------------------------------
  556.    Function       Sets the default cursor mode to be used by makewindow.
  557.    Syntax         void setcursordefault( int cursormode );
  558.    Remarks        This routine simply assigns a value to the global variable
  559.                   cursordefault.  This value is already assigned by initwindow
  560.                   to the current cursor mode.  If a specific cursor mode is
  561.                   required for the initial window as well, use setcursor
  562.                   instead before initwindow.
  563.    Return value   None.
  564.    See also       initwindow, makewindow, setcursor (QWIKC)
  565.  
  566.    ---------------------------------------------------------------------------
  567.    setvirtualsize                                                        WNDWC
  568.    ---------------------------------------------------------------------------
  569.    Function       Sets the dimensions for the virtual screen of virtual
  570.                   windows.
  571.    Syntax         void setvirtualsize( unsigned char rows,
  572.                                        unsigned char cols );
  573.    Remarks        This optional function sets the rows-by-columns dimensions
  574.                   for a virtual screen.  Keep in mind that two additional rows
  575.                   will be internally added for titles if borders are used.
  576.                   The default at startup is the CRT screen size.
  577.    Return value   None.
  578.    Restrictions   Maximum buffer size is 64k.
  579.    See also       makewindow
  580.    Example        To set the size for a virtual screen with 80 columns and a
  581.                   maximum number of rows:
  582.  
  583.                     setvirtualsize( 253, 80 );
  584.  
  585.                   The resulting size would be (253+2)*80*2 = 40,800 bytes
  586.  
  587.  
  588.    Chapter 2, Procedures and Functions                                 Page 10
  589.    WNDWC Multi-level Virtual Windows              Reference Guide, Version 2.0
  590.  
  591.  
  592.                   which is under 64k.  Rows 254 and 255 would be reserved for
  593.                   top and bottom titles on the border.
  594.  
  595.    ---------------------------------------------------------------------------
  596.    setwindowmodes                                                        WNDWC
  597.    ---------------------------------------------------------------------------
  598.    Function       Sets the window modes to be used by makewindow.
  599.    Syntax         void setwindowmodes( int sumofallmodes );
  600.    Remarks        There are several different modes that can be used:
  601.  
  602.       RELMODE       - Window-relative frame of reference, no underlay
  603.       PERMMODE      - Can't be moved or removed, no underlay
  604.       SHADOWLEFT    - Shadow on the left side
  605.       SHADOWRIGHT   - Shadow on the right side
  606.       ZOOMMODE      - Zoom effect on make, show and accesswindow
  607.       HIDDENMODE    - Create window as hidden
  608.       VIRTUALMODE   - Create virtual screen as well
  609.       CURSOROFFMODE - Leaves cursor off for window
  610.       SEETHRUMODE   - Doesn't clear area inside window
  611.       NOHIDEMODE    - Ignores request to hide window
  612.       NOACCESSMODE  - Ignores request to access window
  613.       NOMOVEMODE    - Ignores request to move/resize window
  614.  
  615.                   The startup mode is equivalent to zero while the base window
  616.                   is PERMMODE.  The modes should be summed logically, but can
  617.                   also be done arithmetically with care.  All PERMMODE windows
  618.                   must be created first.
  619.    Return value   None.
  620. See also       makewindow
  621.    Example        Set the modes for the next window to have a right shadow,
  622.                   zoom effect, cursor off, and a virtual screen:
  623.  
  624.                     setwindowmodes( SHADOWRIGHT | ZOOMMODE | CURSOROFFMODE
  625.                                     | VIRTUALMODE );
  626.  
  627.    Example        Set the modes back to defaults:
  628.  
  629.                     setwindowmodes( 0 );
  630.  
  631.    ---------------------------------------------------------------------------
  632.    showwindow                                                            WNDWC
  633.    ---------------------------------------------------------------------------
  634.    Function       Shows a hidden window to become the current top window on
  635.                   the CRT.
  636.    Syntax         void showwindow( int windowname );
  637.    Remarks        The underlay is saved from the screen and the window is
  638.                   restored from RAM to become the new top window.  Invalid
  639.                   window names are simply ignored.  Virtual windows are
  640.                   updated before being shown.  Zoom effect is optional.
  641.    Return value   None.
  642.    Screens        All video pages.
  643.    EOS            Set to (1,1).
  644.    Heap           Temporarily uses (underlay size * 1.5).
  645.    Upon return    Forced to write to CRT.
  646.    See also       hidewindow, accesswindow
  647.  
  648.  
  649.    Chapter 2, Procedures and Functions                                 Page 11
  650.    WNDWC Multi-level Virtual Windows              Reference Guide, Version 2.0
  651.  
  652.  
  653.  
  654.    ---------------------------------------------------------------------------
  655.    titlewindow                                                           WNDWC
  656.    ---------------------------------------------------------------------------
  657.    Function       Places a title on the current window.
  658.    Syntax         void titlewindow( int toporbottom, int justify,
  659.                                     int titleattr, char *title );
  660.    Remarks        There are six positions where the title can be placed in any
  661.                   combination of TOP or BOTTOM, and LEFT, CENTER, or RIGHT.
  662.                   titleattr is the title attribute (SAMEATTR is permitted).
  663.                   The titles can be written to hidden windows or virtual
  664.                   screens as well.  titleofs can be adjusted for
  665.                   justification.
  666.    Return value   None.
  667.    Screens        All video pages.
  668.    EOS            Unaltered.
  669.    See also       titleofs in Data Structure section.
  670.  
  671.    ---------------------------------------------------------------------------
  672.    vresizewindow                                                         WNDWC
  673.    ---------------------------------------------------------------------------
  674.    Function       Resizes the current top virtual window.
  675.    Syntax         void vresizewindow( int numofrows, int numofcols );
  676.    Remarks        The top window is resized by moving the right and/or bottom
  677.                   border.  If NOMOVEMODE or PERMMODE has been set for this
  678.                   window, the function does nothing.  Shadows are fully
  679.                   supported.  Margins are respected.
  680.    Return value   None.
  681.    Restrictions   None.
  682.    Heap           Maximum requirement is full screen size plus the underlay
  683.                   size.
  684.    Upon return    Forced to write to CRT.
  685.    See also       vzoomwindow
  686.  
  687.    ---------------------------------------------------------------------------
  688.    vscrollview                                                           WNDWC
  689.    ---------------------------------------------------------------------------
  690.    Function       Alters the upper left viewing reference point of the current
  691.                   virtual screen by a relative number of rows and columns.
  692.                   The view window is also updated no matter where its location
  693.                   even if hidden or overlapped.
  694.    Syntax         void vscrollview( int numofrows, int numofcols );
  695.    Remarks        The reference point may be adjusted to keep the viewing
  696.                   window within the virtual window limits.  Works in any
  697.                   "writeto" mode.
  698.    Return value   None.
  699.    Restrictions   None.
  700.    Heap           If covered, wsrows * wcols * 5 bytes is temporarily used.
  701.    See also       vviewrc, vviewrcrel
  702.  
  703.    ---------------------------------------------------------------------------
  704.    vupdatecursor                                                         WNDWC
  705.    ---------------------------------------------------------------------------
  706.    Function       Updates the current virtual window cursor if it is the top
  707.                   window on the CRT.
  708.  
  709.  
  710.    Chapter 2, Procedures and Functions                                 Page 12
  711.    WNDWC Multi-level Virtual Windows              Reference Guide, Version 2.0
  712.  
  713.  
  714.    Syntax         void vupdatecursor(void);
  715.    Remarks        When the cursor is moved on the virtual screen, the cursor
  716.                   may or may not be seen in the view.  This routine updates
  717.                   the location.  Works in any "writeto" mode.
  718.    Return value   None.
  719.    See also       vupdatetitles, vupdateview, vupdatewindow
  720.  
  721.    ---------------------------------------------------------------------------
  722.    vupdaterows                                                           WNDWC
  723.    ---------------------------------------------------------------------------
  724.    Function       Updates certain rows in the current virtual window view only
  725.                   on the top window.
  726.    Syntax         void vupdaterows( unsigned char row, unsigned char rows );
  727.    Remarks        This routine is primarily used for fast response for spot
  728.                   updates for data entry or the like where the fastest speed
  729.                   is desirable.  If the window is not the top window, the
  730.                   entire view is updated.
  731.    Return value   None.
  732.    See also       vupdateview, vupdatewindow
  733.  
  734.    ---------------------------------------------------------------------------
  735.    vupdatetitles                                                         WNDWC
  736.    ---------------------------------------------------------------------------
  737.    Function       Updates the current virtual window titles.  It is also
  738.                   updated no matter where its location even if hidden or
  739.                   overlapped.
  740.    Syntax         void vupdatetitles(void);
  741.    Remarks        This routine updates the titles to the window and truncates
  742.                   them to fit in the current view.  Works in any "writeto"
  743.                   mode.
  744.    Return value   None.
  745.    Heap           If covered, wsrows * wcols * 5 bytes is temporarily used.
  746.    See also       vupdatecursor, vupdateview, vupdatewindow
  747.  
  748.    ---------------------------------------------------------------------------
  749.    vupdateview                                                           WNDWC
  750.    ---------------------------------------------------------------------------
  751.    Function       Updates the current virtual window view.  It is also updated
  752.                   no matter where its location even if hidden or overlapped.
  753.    Syntax         void vupdateview(void);
  754.    Remarks        This routine updates the full view of the window.  Works in
  755.                   any "writeto" mode.
  756.    Return value   None.
  757.    Heap           If covered, wsrows * wcols * 5 bytes is temporarily used.
  758.    See also       vupdaterows, vupdatetitles, vupdatewindow
  759.  
  760.    ---------------------------------------------------------------------------
  761.    vupdatewindow                                                         WNDWC
  762.    ---------------------------------------------------------------------------
  763.    Function       Updates the current virtual window including the view,
  764.                   titles and the cursor.  It is also updated no matter where
  765.                   its location even if hidden or overlapped.
  766.    Syntax         void vupdatewindow(void);
  767.    Remarks        This is the main routine to update virtual windows.  This
  768.                   routine simply executes three procedures: vupdatecursor,
  769.  
  770.  
  771.    Chapter 2, Procedures and Functions                                 Page 13
  772.    WNDWC Multi-level Virtual Windows              Reference Guide, Version 2.0
  773.  
  774.  
  775.                   vupdateview, and vupdatetitles.  Works in any "writeto"
  776.                   mode.
  777.    Return value   None.
  778.    Heap           If covered, wsrows * wcols * 5 bytes is temporarily used.
  779.    See also       vupdatecursor, vupdaterows, vupdatetitles, vupdateview
  780.  
  781.    ---------------------------------------------------------------------------
  782.    vviewrc                                                               WNDWC
  783.    ---------------------------------------------------------------------------
  784.    Function       Alters the upper left viewing reference point of the current
  785.                   virtual window.
  786.    Syntax         void vviewrc( unsigned char row, unsigned char col );
  787.    Remarks        The reference point may be adjusted to keep the viewing
  788.                   window within the virtual window limits.  Works in any
  789.                   "writeto" mode.  It does not update the viewing window.
  790.    Return value   None.
  791.    Restrictions   None.
  792.    See also       vviewrcrel, vscrollview
  793.  
  794.    ---------------------------------------------------------------------------
  795.    vviewrcrel                                                            WNDWC
  796.    ---------------------------------------------------------------------------
  797.    Function       Alters the upper left viewing reference point of the current
  798.                   virtual window by a relative number of rows and columns.
  799.    Syntax         void vviewrcrel( int numofrows, int numofcols );
  800.    Remarks        The reference point may be adjusted to keep the viewing
  801.                   window within the virtual window limits.  Works in any
  802.                   "writeto" mode.  It does not update the viewing window.
  803.    Return value   None.
  804.    Restrictions   None.
  805.    See also       vviewrc, vscrollview
  806.  
  807.    ---------------------------------------------------------------------------
  808.    vzoomwindow                                                           WNDWC
  809.    ---------------------------------------------------------------------------
  810.    Function       Toggles top virtual window between full screen size and
  811.                   original size.
  812.    Syntax         void vzoomwindow(void);
  813.    Remarks        If the window is less than full size, the window is zoomed
  814.                   to full size and centered if necessary.  Executing the
  815.                   function again will restore the size and location of this
  816.                   window.  If NOMOVEMODE or PERMMODE has been set for this
  817.                   window, the function does nothing.  Shadows are fully
  818.                   supported.  Margins are respected.
  819.    Return value   None.
  820.    Heap           Maximum requirement is full screen size plus the underlay
  821.                   size.
  822.    Upon return    Forced to write to CRT.
  823.    See also       vresizewindow
  824.  
  825.    ---------------------------------------------------------------------------
  826.    weosc                                                                 WNDWC
  827.    ---------------------------------------------------------------------------
  828.    Function       Returns the window-relative column of the EOS marker.
  829.    Syntax         unsigned char weosc(void);
  830.  
  831.  
  832.    Chapter 2, Procedures and Functions                                 Page 14
  833.    WNDWC Multi-level Virtual Windows              Reference Guide, Version 2.0
  834.  
  835.  
  836.    Remarks        Operates on the currently written screen.  The upper left
  837.                   corner of the window is (1,1).
  838.    Return value   weosc returns an unsigned char between 1 and 255.
  839.    Screens        All video pages and virtual screens.
  840.    See also       weosr, weostorc, weosln, wgotoeos
  841.  
  842.    ---------------------------------------------------------------------------
  843.    weosln                                                                WNDWC
  844.    ---------------------------------------------------------------------------
  845.    Function       Moves the EOS marker to column 1 of the next window-relative
  846.                   row with a possible scroll up.
  847.    Syntax         void weosln(void);
  848.    Remarks        Operates on the currently written window.  If weosr becomes
  849.                   greater than the number of window rows, then the window will
  850.                   scroll up.  The new blank row will have the attribute set by
  851.                   wndwattr which is the window attribute.
  852.    Return value   None.
  853.    Screens        All video pages and virtual screens.
  854.    EOS            Updated to first cleared column of the cleared row.
  855.    See also       weosr, weosc, weostorc, wgotoeos
  856.  
  857.    ---------------------------------------------------------------------------
  858.    weostorc                                                              WNDWC
  859.    ---------------------------------------------------------------------------
  860.    Function       Positions the EOS marker relative to the current window.
  861.    Syntax         void weostorc( unsigned char row, unsigned char col );
  862.    Remarks        Use this function to manually locate the EOS marker.  All
  863.                   EOS functions will write where this marker is located on the
  864.                   currently written screen.
  865.    Return value   None.
  866.    Screens        All video pages and virtual screens.
  867.    EOS            Updated.
  868.    Restrictions   Stay within the window limits.
  869.    See also       QWIKC, weosr, weosc, weosln, wgotoeos
  870.  
  871.    ---------------------------------------------------------------------------
  872.    weosr                                                                 WNDWC
  873.    ---------------------------------------------------------------------------
  874.    Function       Returns the window-relative row of the EOS marker.
  875.    Syntax         unsigned char weosr(void);
  876.    Remarks        Operates on the currently written screen.  The upper left
  877.                   corner of the window is (1,1).
  878.    Return value   weosr returns an unsigned char between 1 and 255.
  879.    Screens        All video pages and virtual screens.
  880.    See also       weosc, weostorc, weosln, wgotoeos
  881.  
  882.    ---------------------------------------------------------------------------
  883.    wbrdrh                                                                WNDWC
  884.    ---------------------------------------------------------------------------
  885.    Function       Places a horizontal partition of the same type as the window
  886.                   border from edge to edge of the border.
  887.    Syntax         void wbrdrh( unsigned char row );
  888.    Remarks        This routine divides a window using wsbrdr and brdrattr from
  889.                   the top window record.  It provides a horizontal line
  890.                   complete with a tee on each end using parts BRDR_HL,
  891.  
  892.  
  893.    Chapter 2, Procedures and Functions                                 Page 15
  894.    WNDWC Multi-level Virtual Windows              Reference Guide, Version 2.0
  895.  
  896.  
  897.                   BRDR_LT, and BRDR_RT.  If brdrattr is set to SAMEATTR, then
  898.                   the attributes will remain the same on the screen.  If there
  899.                   is no border, the function does nothing.
  900.    Return value   None.
  901.    Screens        All video pages and virtual screens.
  902.    EOS            Unaltered.
  903.    Restrictions   Stay within window limits.  Cannot use NO_BORDER.
  904.    See also       wbrdrpart, wbrdrv, wlineh, wlinepart, wlinev
  905.  
  906.    ---------------------------------------------------------------------------
  907.    wbrdrpart                                                             WNDWC
  908.    ---------------------------------------------------------------------------
  909.    Function       Places a single border part of the same type as the window
  910.                   border at a window-relative location.
  911.    Syntax         void wbrdrpart( unsigned char row, unsigned char col,
  912.                                   int part )
  913.    Remarks        This routine places the part using wsbrdr and brdrattr from
  914.                   the top window record.  It is usually used for crosses or
  915.                   tees, but there are 15 different parts that can be used.  If
  916.                   brdrattr is set to SAMEATTR, then the attributes will remain
  917.                   the same on the screen.  If there is no border, the function
  918.                   does nothing.
  919.    Return value   None.
  920.    Screens        All video pages and virtual screens.
  921.    EOS            Unaltered.
  922.    Restrictions   Stay within window limits.  Cannot use NO_BORDER.
  923.    See also       wbrdrh, wbrdrpart, wlineh, wlinev, wlinepart
  924.  
  925.    ---------------------------------------------------------------------------
  926.    wbrdrv                                                                WNDWC
  927.    ---------------------------------------------------------------------------
  928.    Function       Places a vertical partition of the same type as the window
  929.                   border from edge to edge of the border.
  930.    Syntax         void wbrdrv( unsigned char row );
  931.    Remarks        This routine divides a window using wsbrdr and brdrattr from
  932.                   the top window record.  It provides a vertical line complete
  933.                   with a tee on each end using parts BRDR_VL, BRDR_TT, and
  934.                   BRDR_BT.  If brdrattr is set to SAMEATTR, then the
  935.                   attributes will remain the same on the screen.  If there is
  936.                   no border, the function does nothing.
  937.    Return value   None.
  938.    Screens        All video pages and virtual screens.
  939.    EOS            Unaltered.
  940.    Restrictions   Stay within window limits.  Cannot use NO_BORDER.
  941.    See also       wbrdrh, wbrdrpart, wlineh, wlinev, wlinepart
  942.  
  943.    ---------------------------------------------------------------------------
  944.    wclreol                                                               WNDWC
  945.    ---------------------------------------------------------------------------
  946.    Function       Clears a row to End-Of-Line (EOL).
  947.    Syntax         void wclreol( unsigned char row, unsigned char col,
  948.                                 int attr );
  949.    Remarks        The row is cleared using the attribute attr (SAMEATTR is
  950.                   permitted).  To clear using the window attribute, pass attr
  951.                   as tws.wndwattr.
  952.  
  953.  
  954.    Chapter 2, Procedures and Functions                                 Page 16
  955.    WNDWC Multi-level Virtual Windows              Reference Guide, Version 2.0
  956.  
  957.  
  958.    Return value   None.
  959.    Screens        All video pages and virtual screens.
  960.    EOS            Set to (row,col).
  961.    Restrictions   Stay within window limits.
  962.    See also       wdelline, wclrline, wclreos
  963.  
  964.    ---------------------------------------------------------------------------
  965.    wclreos                                                               WNDWC
  966.    ---------------------------------------------------------------------------
  967.    Function       Clears a row from EOS to End-Of-Line.
  968.    Syntax         void wclreos( int attr );
  969.    Remarks        The row is cleared starting at the EOS marker using the
  970.                   attribute attr (SAMEATTR is permitted).  To clear using the
  971.                   window attribute, pass attr as tws.wndwattr.
  972.    Return value   None.
  973.    Screens        All video pages and virtual screens.
  974.    EOS            Unaltered.
  975.    Restrictions   Stay within window limits.
  976.    See also       wdelline, wclrline, wclreos
  977.  
  978.    ---------------------------------------------------------------------------
  979.    wclrfield                                                             WNDWC
  980.    ---------------------------------------------------------------------------
  981.    Function       Clears a field.
  982.    Syntax         void wclrfield( unsigned char row, unsigned char col,
  983.                                   unsigned char cols, int attr );
  984.    Remarks        The field is cleared starting at (row,col) using the
  985.                   attribute attr (SAMEATTR is permitted).  To clear using the
  986.                   window attribute, pass attr as tws.wndwattr.
  987.    Return value   None.
  988.    Screens        All video pages and virtual screens.
  989.    EOS            Set to (row,col).
  990.    Restrictions   Stay within window limits.
  991.    See also       wclreol, wclreos, wclrfieldeos
  992.  
  993.    ---------------------------------------------------------------------------
  994.    wclrfieldeos                                                          WNDWC
  995.    ---------------------------------------------------------------------------
  996.    Function       Clears a field starting at EOS.
  997.    Syntax         void wclrfieldeos( unsigned char cols, int attr );
  998.    Screens        All video pages and virtual screens.
  999.    Remarks        The field is cleared starting at EOS using the attribute
  1000.                   attr (SAMEATTR is permitted).  To clear using the window
  1001.                   attribute, pass attr as tws.wndwattr.
  1002.    Return value   None.
  1003.    EOS            Unaltered.
  1004.    Restrictions   Stay within window limits.
  1005.    See also       wclreol, wclreos, wclrfield
  1006.  
  1007.    ---------------------------------------------------------------------------
  1008.    wclrline                                                              WNDWC
  1009.    ---------------------------------------------------------------------------
  1010.    Function       Clears a specified row.
  1011.    Syntax         void wclrline( unsigned char row );
  1012.    Remarks        The row is cleared using the window attribute tws.wndwattr
  1013.  
  1014.  
  1015.    Chapter 2, Procedures and Functions                                 Page 17
  1016.    WNDWC Multi-level Virtual Windows              Reference Guide, Version 2.0
  1017.  
  1018.  
  1019.                   (SAMEATTR is permitted).
  1020.    Return value   None.
  1021.    Screens        All video pages and virtual screens.
  1022.    EOS            Set to (row,1).
  1023.    Restrictions   Stay within window limits.
  1024.    See also       wdelline, wclreol, wclreos
  1025.  
  1026.    ---------------------------------------------------------------------------
  1027.    wclrscr                                                               WNDWC
  1028.    ---------------------------------------------------------------------------
  1029.    Function       Clears the entire window.
  1030.    Syntax         void wclrscr(void);
  1031.    Remarks        Clears the screen using the window attribute tws.wndwattr
  1032.                   (SAMEATTR is permitted).
  1033.    Return value   None.
  1034.    Screens        All video pages and virtual screens.
  1035.    EOS            Set to (1,1).
  1036.    See also       wclrline, wdelline, winsline
  1037.  
  1038.    ---------------------------------------------------------------------------
  1039.    wclrtitle                                                             WNDWC
  1040.    ---------------------------------------------------------------------------
  1041.    Function       Clears the titles from the specified row.
  1042.    Syntax         void wclrtitle( int toporbottom );
  1043.    Remarks        Clears the top or bottom border where the titles are located
  1044.                   and restores the original border if any.  If wsbrdr is
  1045.                   NO_BORDER, the row is simply cleared.  Works on both fixed
  1046.                   and virtual titles.
  1047.    Return value   None.
  1048.    Screens        All video pages and virtual screens.
  1049.    EOS            Unaltered.
  1050.    See also       titlewindow, vupdatetitle
  1051.  
  1052.    ---------------------------------------------------------------------------
  1053.    wdelline                                                              WNDWC
  1054.    ---------------------------------------------------------------------------
  1055.    Function       Deletes a line at a specified row, scrolls up the remaining
  1056.                   part of the window and clears the bottom row.
  1057.    Syntax         void winsline( unsigned char row );
  1058.    Remarks        Similar to Turbo C's delline, the indicated row of the
  1059.                   window will be deleted.  The bottom row is cleared with
  1060.                   tws.wndwattr (SAMEATTR is permitted).  The cursor is not
  1061.                   moved, but is ready to be moved with wgotoeos as EOS is set
  1062.                   to the first column of the cleared row.
  1063.    Return value   None.
  1064.    Screens        All video pages and virtual screens.
  1065.    EOS            Updated to first cleared column of the cleared row.
  1066.    Restrictions   Stay within window limits.
  1067.    See also       winsline, wscrollup, wgotoeos
  1068.  
  1069.    ---------------------------------------------------------------------------
  1070.    wgotoeos                                                              WNDWC
  1071.    ---------------------------------------------------------------------------
  1072.    Function       Positions the cursor to match the EOS marker on both fixed
  1073.                   or virtual windows.
  1074.  
  1075.  
  1076.    Chapter 2, Procedures and Functions                                 Page 18
  1077.    WNDWC Multi-level Virtual Windows              Reference Guide, Version 2.0
  1078.  
  1079.  
  1080.    Syntax         void wgotoeos(void);
  1081.    Remarks        The cursor is simply moved to match the position of the EOS
  1082.                   marker of the currently written video page.  tws.wswherer
  1083.                   and tws.wswherec are also updated.  For virtual windows,
  1084.                   this routine also calls vupdatecursor.
  1085.    Return value   None.
  1086.    Screens        All video pages and virtual screens.
  1087.    EOS            Unaltered.
  1088.    See also       weosr, weosc, weostorc, weosln, wgotorc, vupdatecursor
  1089.    Restrictions   EOS should be within window limits.
  1090.    Example        Center a string in a window and place the cursor at the end
  1091.                   of the string:
  1092.  
  1093.                     wwritec( 1, "Correct (Y/N)? " );
  1094.                     wgotoeos();
  1095.  
  1096.    ---------------------------------------------------------------------------
  1097.    wgotorc                                                               WNDWC
  1098.    ---------------------------------------------------------------------------
  1099.    Function       Positions the cursor relative to the window.
  1100.    Syntax         void wgotorc( unsigned char row, unsigned char col );
  1101.    Remarks        The cursor is positioned to the currently written window.
  1102.                   For virtual windows, this routine also calls vupdatecursor.
  1103.    Return value   None.
  1104.    Screens        All video pages and virtual screens.
  1105.    EOS            Unaltered.
  1106.    Restrictions   Stay within the window limits.
  1107.    See also       wgotoeos, wwherer, wwherec
  1108.  
  1109.    ---------------------------------------------------------------------------
  1110.    winsline                                                              WNDWC
  1111.    ---------------------------------------------------------------------------
  1112.    Function       Inserts a blank line at a specified row using the window
  1113.                   attribute tws.wndwattr scrolling down the remaining part.
  1114.    Syntax         void winsline( unsigned char row );
  1115.    Remarks        Similar to Turbo C's insline, the indicated row of the
  1116.                   window is scrolled down and then cleared (SAMEATTR is
  1117.                   permitted).  The cursor is not moved, but is ready to be
  1118.                   moved with wgotoeos as EOS is set to the first column of the
  1119.                   cleared row.
  1120.    Return value   None.
  1121.    Screens        All video pages and virtual screens.
  1122.    EOS            Updated to first cleared column of the cleared row.
  1123.    Restrictions   Stay within window limits.
  1124.    See also       wdelline, wscrolldown, wgotoeos
  1125.  
  1126.    ---------------------------------------------------------------------------
  1127.    wlineh                                                                WNDWC
  1128.    ---------------------------------------------------------------------------
  1129.    Function       Places a horizontal line in the window using the window line
  1130.                   set.
  1131.    Syntax         void wlineh( unsigned char row, unsigned char col,
  1132.                                unsigned char cols );
  1133.    Remarks        This routine divides a window using wsline and wndwattr from
  1134.                   the top window record.  It provides just a horizontal line
  1135.  
  1136.  
  1137.    Chapter 2, Procedures and Functions                                 Page 19
  1138.    WNDWC Multi-level Virtual Windows              Reference Guide, Version 2.0
  1139.  
  1140.  
  1141.                   using part BRDR_HL.  If wndwattr is set to SAMEATTR, then
  1142.                   the attributes will remain the same on the screen.  If
  1143.                   wsline=nobrdr, then the function does nothing.
  1144.    Return value   None.
  1145.    Screens        All video pages and virtual screens.
  1146.    EOS            Updated.
  1147.    Restrictions   Stay within window limits.  Cannot use NO_BORDER.
  1148.    See also       wbrdrh, wbrdrpart, wbrdrv, wlinepart, wlinev
  1149.  
  1150.    ---------------------------------------------------------------------------
  1151.    wlinepart                                                             WNDWC
  1152.    ---------------------------------------------------------------------------
  1153.    Function       Places a single line part of the same type as the window
  1154.                   line set at a window-relative location.
  1155.    Syntax         void wlinepart( unsigned char row, unsigned char col,
  1156.                                   int part );
  1157.    Remarks        This routine places the part using wsline and wndwattr from
  1158.                   the top window record.  It is usually used for crosses or
  1159.                   tees, but there are 15 different parts that can be used.  If
  1160.                   SAMEATTR is used for wndwattr, then the attributes will
  1161.                   remain the same on the screen.  If wsline=NO_BORDER, the
  1162.                   function is ignored.
  1163.    Return value   None.
  1164.    Screens        All video pages and virtual screens.
  1165.    EOS            Updated.
  1166.    Restrictions   Stay within window limits.  Cannot use NO_BORDER.
  1167.    See also       wbrdrh, wbrdrpart, wbrdrv, wlineh, wlinev
  1168.  
  1169.    ---------------------------------------------------------------------------
  1170.    wlinev                                                                WNDWC
  1171.    ---------------------------------------------------------------------------
  1172.    Function       Places a vertical line in the window using the window line
  1173.                   set.
  1174.    Syntax         void wlinev( unsigned char row, unsigned char col,
  1175.                                char rows );
  1176.    Remarks        This routine divides a window using wsline and wndwattr from
  1177.                   the top window record.  It provides just a vertical line
  1178.                   using part BRDR_VL.  If wndwattr is set to SAMEATTR, then
  1179.                   the attributes will remain the same on the screen.  If
  1180.                   wsline=NO_BORDER, then the function does nothing.
  1181.    Return value   None.
  1182.    Screens        All video pages and virtual screens.
  1183.    EOS            Updated.
  1184.    Restrictions   Stay within window limits.  Cannot use NO_BORDER.
  1185.    See also       wbrdrh, wbrdrpart, wbrdrv, wlineh, wlinepart
  1186.  
  1187.    ---------------------------------------------------------------------------
  1188.    writeandviewpage                                                      WNDWC
  1189.    ---------------------------------------------------------------------------
  1190.    Function       Changes the video page to be both viewed and written on the
  1191.                   CRT.
  1192.    Syntax         void writeandviewpage( char pagenum );
  1193.    Remarks        If another video page is available, this routine will switch
  1194.                   to both view and write to that page.  It does nothing if
  1195.                   pagenum is already the currently written video page
  1196.  
  1197.  
  1198.    Chapter 2, Procedures and Functions                                 Page 20
  1199.    WNDWC Multi-level Virtual Windows              Reference Guide, Version 2.0
  1200.  
  1201.  
  1202.                   (qvideo_page) and viewed page (videopage), or if pagenum is
  1203.                   invalid.  All wndwstats are swapped to exact same conditions
  1204.                   as before.
  1205.    Return value   None.
  1206.    Screens        All video pages.
  1207.    EOS            Restored to new page.
  1208.    See also       writetopage, QWIKC
  1209.  
  1210.    ---------------------------------------------------------------------------
  1211.    writetocrt                                                           WNDWC
  1212.    ---------------------------------------------------------------------------
  1213.    Function       Prepares QWIKC and WNDWC to write to the top window on the
  1214.                   CRT and restores TC's window.
  1215.    Syntax         void writetocrt(void);
  1216.    Remarks        This function switches back to writing to the top window on
  1217.                   the CRT after writing to a hidden window or virtual screen.
  1218.    Return value   None.
  1219.    Screens        Back to any video page.
  1220.    EOS            Restored to top window.
  1221.    See also       writetohidden, writetovirtual
  1222.  
  1223.    ---------------------------------------------------------------------------
  1224.    writetohidden                                                         WNDWC
  1225.    ---------------------------------------------------------------------------
  1226.    Function       Prepares QWIKC and WNDWC to write to a hidden window.
  1227.    Syntax         void writetohidden( int windowname );
  1228.    Remarks        This function switches to writing to a hidden window.  The
  1229.                   window must be a valid window name, otherwise the program is
  1230.                   terminated with an error message.
  1231.    Return value   None.
  1232.    EOS            Restored to hidden window.
  1233.    See also       writetocrt, writetovirtual
  1234.  
  1235.    ---------------------------------------------------------------------------
  1236.    writetopage                                                           WNDWC
  1237.    ---------------------------------------------------------------------------
  1238.    Function       Changes the video page on which the WNDWC routines write
  1239.                   without changing the viewed page.
  1240.    Syntax         void writetopage( char pagenum );
  1241.    Remarks        If another video page is available, this routine will switch
  1242.                   to write to that page.  It does nothing if pagenum is
  1243.                   already the currently written video page (qvideo_page) or if
  1244.                   the page is invalid.  All wndwstats are swapped to exact
  1245.                   same conditions as before.
  1246.    Return value   None.
  1247.    Screens        All video pages.
  1248.    EOS            Restored to new page.
  1249.    See also       writeandviewpage, QWIKC
  1250.  
  1251.    ---------------------------------------------------------------------------
  1252.    writetovirtual                                                        WNDWC
  1253.    ---------------------------------------------------------------------------
  1254.    Function       Prepares QWIKC and WNDWC to write to a virtual screen.
  1255.    Syntax         void writetovirtual( int windowname );
  1256.    Remarks        This function switches to writing to a virtual screen.  The
  1257.  
  1258.  
  1259.    Chapter 2, Procedures and Functions                                 Page 21
  1260.    WNDWC Multi-level Virtual Windows              Reference Guide, Version 2.0
  1261.  
  1262.  
  1263.                   window must be a valid window name, otherwise, the program
  1264.                   is terminated with an error message.
  1265.    Return value   None.
  1266.    EOS            Restored to virtual screen.
  1267.    See also       writetocrt, writetohidden
  1268.  
  1269.    ---------------------------------------------------------------------------
  1270.    wscrolldown                                                           WNDWC
  1271.    ---------------------------------------------------------------------------
  1272.    Function       Scrolls the current window down and clears the top row with
  1273.                   the window attribute wndwattr.
  1274.    Syntax         void wscrolldown(void);
  1275.    Remarks        The last row of the window will be scrolled out and lost
  1276.                   while the first row will be cleared (SAMEATTR is permitted).
  1277.                   The cursor is not moved, but is ready to be moved with
  1278.                   wgotoeos as EOS is set to the first column of the cleared
  1279.                   row.
  1280.    Return value   None.
  1281.    Screens        All video pages and virtual screens.
  1282.    EOS            Updated to first cleared column of the cleared row.
  1283.    Restrictions   None.
  1284.    See also       wscrollup, wgotoeos
  1285.  
  1286.    ---------------------------------------------------------------------------
  1287.    wscrollup                                                             WNDWC
  1288.    ---------------------------------------------------------------------------
  1289.    Function       Scrolls the current window up and clears the bottom row with
  1290.                   the window attribute wndwattr.
  1291.    Syntax         void wscrollup(void);
  1292.    Remarks        The first row of the window will be scrolled out and lost
  1293.                   while the last row will be cleared (SAMEATTR is permitted).
  1294.                   The cursor is not moved, but is ready to be moved with
  1295.                   wgotoeos as EOS is set to the first column of the cleared
  1296.                   row.
  1297.    Return value   None.
  1298.    Screens        All video pages and virtual screens.
  1299.    EOS            Updated to first cleared column of the cleared row.
  1300.    Restrictions   None.
  1301.    See also       wscrolldown, wgotoeos
  1302.  
  1303.    ---------------------------------------------------------------------------
  1304.    wwherec                                                               WNDWC
  1305.    ---------------------------------------------------------------------------
  1306.    Function       Returns the window-relative column of the cursor on the
  1307.                   currently written video page.
  1308.    Syntax         unsigned char wwherec(void);
  1309.    Remarks        Operates on the currently written video page.  The upper
  1310.                   left corner of the screen is (1,1).
  1311.    Return value   wwherec returns an unsigned char from 1 to 255.
  1312.    Screens        All video pages only.
  1313.    See also       wgotorc, wwherer
  1314.  
  1315.    ---------------------------------------------------------------------------
  1316.    wwherer                                                               WNDWC
  1317.    ---------------------------------------------------------------------------
  1318.  
  1319.  
  1320.    Chapter 2, Procedures and Functions                                 Page 22
  1321.    WNDWC Multi-level Virtual Windows              Reference Guide, Version 2.0
  1322.  
  1323.  
  1324.    Function       Returns the window-relative row of the cursor on the
  1325.                   currently written video page.
  1326.    Syntax         void wwherer(void);
  1327.    Remarks        Operates on the currently written video page.  The upper
  1328.                   left corner of the screen is (1,1).
  1329.    Return value   wwherer returns an unsigned char from 1 to 255.
  1330.    Screens        All video pages only.
  1331.    See also       wgotorc, wwherec
  1332.  
  1333.    ---------------------------------------------------------------------------
  1334.    wwrite                                                                WNDWC
  1335.    ---------------------------------------------------------------------------
  1336.    Function       Writes a string relative to the current window using the
  1337.                   window attribute.
  1338.    Syntax         void wwrite( unsigned char row, unsigned char col,
  1339.                                char *astr );
  1340.    Remarks        This routine writes the string astr at window-relative
  1341.                   (row,col) with the attribute wndwattr from the window
  1342.                   record.  If SAMEATTR is used for wndwattr, then the
  1343.                   attributes will remain the same on the screen.
  1344.    Return value   None.
  1345.    Screens        All video pages and virtual screens.
  1346.    EOS            Updated.
  1347.    Restrictions   Stay within the window limits.  Long strings will not wrap
  1348.                   around to column 1.
  1349.    See also       wwritec, wwritea
  1350.    Example        Write the string "Enter" at (2,1) with the current window
  1351.                   attribute:
  1352.  
  1353.                     wwrite( 2, 1, "Enter" );
  1354.  
  1355.    Example        Write the string "Answer" at (2,1) with the attribute of
  1356.                   flashing white on red and then restore the current window
  1357.                   attribute:
  1358.  
  1359.                     tws.wndwattr = BLINK+WHITE+RED_BG;
  1360.                     wwrite( 2, 1, "Answer" );
  1361.                     tws.wndwattr = tws.origattr;
  1362.  
  1363.    ---------------------------------------------------------------------------
  1364.    wwritec                                                               WNDWC
  1365.    ---------------------------------------------------------------------------
  1366.    Function       Writes a string centered column-wise to the current window
  1367.                   using the window attribute.
  1368.    Syntax         void wwritec( unsigned char row, char *astr );
  1369.    Remarks        This routine writes the string astr centered between the
  1370.                   left and right columns of the window.  The attribute used is
  1371.                   wndwattr from the window structure.  If SAMEATTR is used for
  1372.                   wndwattr, then the attributes will remain the same on the
  1373.                   screen.
  1374.    Return value   None.
  1375.    Screens        All video pages and virtual screens.
  1376.    EOS            Updated.
  1377.    Restrictions   Stay within the window limits.  Long strings will not wrap
  1378.                   around to column 1.
  1379.  
  1380.  
  1381.    Chapter 2, Procedures and Functions                                 Page 23
  1382.    WNDWC Multi-level Virtual Windows              Reference Guide, Version 2.0
  1383.  
  1384.  
  1385.    See also       wwrite, wwritea
  1386.    Example        Write a message centered in a window on row 5:
  1387.  
  1388.                     wwritec( 5, "My message" );
  1389.  
  1390.    ---------------------------------------------------------------------------
  1391.    wwrite_sub                                                            WNDWC
  1392.    ---------------------------------------------------------------------------
  1393.    Function       Writes a substring with a specified length relative to the
  1394.                   current window using the window attribute.
  1395.    Syntax         void wwrite_sub( unsigned char row, unsigned char col,
  1396.                                    int length, char far *astr );
  1397.    Remarks        This routine writes length characters of the string astr at
  1398.                   window-relative (row,col) for the number of columns
  1399.                   specified by length.  This enables you to write substrings.
  1400.                   The attribute used is wndwattr from the window record.  If
  1401.                   wndwattr is set to SAMEATTR, then the attributes will remain
  1402.                   the same on the screen.
  1403.    Return value   None.
  1404.    Screens        All video pages and virtual screens.
  1405.    EOS            Updated.
  1406.    Restrictions   Stay within the window limits.  Long strings will not wrap
  1407.                   around to column 1.
  1408.    See also       wwrite, wwritec
  1409.    Example        The following will write "Testing out this line."  with the
  1410.                   current window attribute:
  1411.  
  1412.                     strcpy( mystring, "Step B: Testing out this line." );
  1413.                     wwrite_sub( 1, 1, 22, &mystring[8] );
  1414.  
  1415.  
  1416.  
  1417.  
  1418.  
  1419.  
  1420.  
  1421.  
  1422.  
  1423.  
  1424.  
  1425.  
  1426.  
  1427.  
  1428.  
  1429.  
  1430.  
  1431.  
  1432.  
  1433.  
  1434.  
  1435.  
  1436.  
  1437.  
  1438.  
  1439.  
  1440.  
  1441.  
  1442.    Chapter 2, Procedures and Functions                                 Page 24
  1443.    WNDWC Multi-level Virtual Windows              Reference Guide, Version 2.0
  1444.  
  1445.  
  1446.    3.  D A T A   S T R U C T U R E
  1447.  
  1448.    This section will help describe the data structure of WNDWC and how it can
  1449.    be adjusted.  The variables in WC20VAR.C are allocated according to the
  1450.    values of the macros set near the beginning of WNDWC20.H.  There are
  1451.    several basic variables, but if desired, there are additional variables for
  1452.    virtual windows and multiple video pages.  Please refer to the source code
  1453.    in WC20VAR.C and WNDWC20.H for the exact listing.
  1454.  
  1455.  
  1456.    BASIC TYPES
  1457.  
  1458.    Basic Types - These types are used for all windows and modes to define the
  1459.    data structure.  This will describe the purpose of each type.
  1460.  
  1461.      Type          Description
  1462.      ------------  -----------------------------------------------------------
  1463.      borders       This enumerated type gives a name for 15 different border
  1464.                    styles each having 15 different parts already assigned in
  1465.                    the static array brdr.  The name NO_BORDER is reserved.
  1466.  
  1467.                      NO_BORDER           - No border at all.  Just the text
  1468.                                            area.
  1469.                      BLANK_BORDER        - Blank character on all sides.
  1470.                      SINGLE_BORDER       - Single lines on all sides.
  1471.                      DOUBLE_BORDER       - Double lines on all sides.
  1472.                      HDOUBLE_BORDER      - Horizontal double lines.  Single
  1473.                                            vertical lines.
  1474.                      VDOUBLE_BORDER      - Vertical double lines.  Single
  1475.                                            horizontal lines.
  1476.                      SOLID_BORDER        - Solid box character on all sides.
  1477.                      EVEN_SOLID_BORDER   - Vertical solid box.  Horizontal
  1478.                                            half box.
  1479.                      THIN_SOLID_BORDER_1 - Half box on all sides.  Squeezed
  1480.                                            horizontally.
  1481.                      THIN_SOLID_BORDER_2 - Half box on all sides.  Squeezed
  1482.                                            vertically.
  1483.                      LHATCH_BORDER       - Light hatch character on all sides.
  1484.                      MHATCH_BORDER       - Medium hatch character on all
  1485.                                            sides.
  1486.                      HHATCH_BORDER       - Heavy hatch character on all sides.
  1487.                      USER_BORDER_1       - User defined border.
  1488.                      USER_BORDER_2       - User defined border.
  1489.  
  1490.      brdrparts     Each border has 15 different parts.  This enumerated type
  1491.                    identifies each part by name.  Using acronyms, the relative
  1492.                    position can be easily identified.  For example, BRDR_TL
  1493.                    means the Top Left border part.  The order corresponds with
  1494.                    the brdr_t type:
  1495.  
  1496.  
  1497.  
  1498.  
  1499.  
  1500.  
  1501.  
  1502.  
  1503.    Chapter 3, Data Structure                                           Page 25
  1504.    WNDWC Multi-level Virtual Windows              Reference Guide, Version 2.0
  1505.  
  1506.  
  1507.                      Relative Position      The first letter means:
  1508.                      ------------------        T = Top         B = Bottom
  1509.                      TL  TH  TT  TH  TR        V = Vertical    H = Horizontal
  1510.                      LV      VL      RV        L = Left        R = Right
  1511.                      LT  HL  CL  HL  RT        C = Cross
  1512.                      LV      VL      RV     Second letter exceptions:
  1513.                      BL  BH  BT  BH  BR        T = Tee         L = Line
  1514.  
  1515.      brdr_t        This type provides the array for storing a border.  All 15
  1516.                    different border parts can be accessed by merely indexing
  1517.                    the array.
  1518.  
  1519.      dir_t         This enumerated type identifies various directions.  They
  1520.                    can be extended.
  1521.  
  1522.      margin_t      Groups the margins used for moving or resizing windows.
  1523.  
  1524.      windownames   This enumerated type gives a name or handle for each window
  1525.                    to uniquely identify a window structure for random access.
  1526.                    Any additional name can be used, but three are reserved:
  1527.  
  1528.                      Name       Description
  1529.                      ---------- ---------------------------------------------
  1530.                      WINDOW0    Identifies the initial base screen and must be
  1531.                                 first in the list.
  1532.                      FREEWINDOW Identifies virtual screen records that are
  1533.                                 free to be overwritten.
  1534.                      AWINDOW    A generic name to be used when the window does
  1535.                                 not need to be unique.  It is usually used for
  1536.                                 temporary windows like error messages.
  1537.  
  1538.  
  1539.      wndwstat_t    This type sets up the window structure.  Each field in the
  1540.                    structure is worth describing.  The "ws" prefix is an
  1541.                    acronym meaning wndwstat.  There are 50 bytes per
  1542.                    structure.
  1543.  
  1544.                      wsrow .. wscol2 - These variables identify the location
  1545.                      and size of the window INCLUDING the border if any.  The
  1546.                      "2" suffix means the right column or bottom row location.
  1547.  
  1548.                      wrow .. wcol2 - These variables identify the location and
  1549.                      size of the window EXCLUDING the border if any.  The "2"
  1550.                      suffix means the right column or bottom row location.
  1551.  
  1552.                      wndwattr/brdrattr/origattr - These the attributes for the
  1553.                      window and border respectively.  They can even be set to
  1554.                      SAMEATTR.  origattr is a second copy of wndwattr used to
  1555.                      restore wndwattr to its original value.
  1556.  
  1557.                      wsbrdr/wsline - The former is the current border style
  1558.                      while the latter is a line set that can be used within
  1559.                      the window.  When a window is made, these two values are
  1560.                      the same, but wsline is available to be changed to the
  1561.                      needed line set.
  1562.  
  1563.  
  1564.    Chapter 3, Data Structure                                           Page 26
  1565.    WNDWC Multi-level Virtual Windows              Reference Guide, Version 2.0
  1566.  
  1567.  
  1568.  
  1569.                      wsname - The unique name assigned to the window
  1570.                      structure.
  1571.  
  1572.                      wswherer/wswherec - These variables save the window-
  1573.                      relative row and column of the cursor.
  1574.  
  1575.                      wsmodes - Saves all the modes that created the window
  1576.                      including the current status.
  1577.  
  1578.                      wscursor - Save the cursor mode used with this window.
  1579.  
  1580.                      ulcol .. ulbytes - Saves the location and size of the
  1581.                      underlay of a window including the border and shadow if
  1582.                      any.
  1583.  
  1584.                      ulptr - Points to the saved underlay in the heap.
  1585.  
  1586.                      vscr - Holds the QWIKC screen data for this window.
  1587.  
  1588.                      refrow/refcol - These two scratch coordinates are used
  1589.                      for two cases.  It saves the absolute row/col where a
  1590.                      window is positioned before it is hidden.  For virtual
  1591.                      screen stats, it saves the view reference point.
  1592.  
  1593.                      viewbrdr - Saves the border style originally created with
  1594.                      the window.  wsbrdr differs from viewbrdr in that wsbrdr
  1595.                      contains the current border.  For virtual screens, wsbrdr
  1596.                      is always set to NO_BORDER even though the view on the
  1597.                      CRT may be a different style.
  1598.  
  1599.                      vi - Virtual screen index for its associated virtual
  1600.                      window stat if any.
  1601.  
  1602.  
  1603.    MACROS
  1604.  
  1605.    Macros - These macros are used to control the data structure size or to
  1606.    conveniently set window mode bits.
  1607.  
  1608.      Macro             Value  Description
  1609.      --------------    -----  ------------------------------------------------
  1610.      MAXWINDOW         1-254  Set by the user, this value determines the
  1611.                               maximum number of windows that can be on the CRT
  1612.                               on any video page.  This sets the amount of
  1613.                               static data to be used.
  1614.  
  1615.      MAXVIRTUALWINDOW  0-254  Set by the user, this value determines the total
  1616.                               number of virtual screens minus one that will be
  1617.                               maintained at any one time.  If no virtual
  1618.                               windows are wanted, undefine the macro
  1619.                               ADDVIRTUAL.
  1620.  
  1621.      MAXPAGEUSED       0 - 7  Set by the user, this value determines the
  1622.                               highest page number to be managed in a multi-
  1623.  
  1624.  
  1625.    Chapter 3, Data Structure                                           Page 27
  1626.    WNDWC Multi-level Virtual Windows              Reference Guide, Version 2.0
  1627.  
  1628.  
  1629.                               page program.  If only page 0 is going to be
  1630.                               used (which is usually the case), then undefine
  1631.                               the directive MULTIPAGE.  This will reduce the
  1632.                               static data by a significant amount.
  1633.  
  1634.    Window Modes - There are several window modes and combinations of modes
  1635.    that can be set using setwindowmodes and saved in the variable windowmodes.
  1636.    This is a list of those modes, values and descriptions.  After the window
  1637.    is created, the modes are saved in wsmodes as well as the "to" modes which
  1638.    indicate the status of the window.
  1639.  
  1640.      Macro           Value   Description
  1641.      --------------  ------  -------------------------------------------------
  1642.      RELMODE         0x0001  (Bit 0) Simply overwrites the screen relative to
  1643.                              the current window.  The row/col coordinate is
  1644.                              window relative.  Works and stays in the current
  1645.                              writeto mode.  This is usually used for flexible
  1646.                              screen design.  The stats are only temporary and
  1647.                              lost after changing windows.  To get back to the
  1648.                              parent window, use removewindow.
  1649.      PERMMODE        0x0002  (Bit 1) Makes the window permanent on the screen.
  1650.                              This means that no underlay is saved.  These
  1651.                              windows must be the first ones created.  They can
  1652.                              be accessed, but be sure no other window is
  1653.                              covering it (wi<=pli) before writing to the
  1654.                              screen, because they are not necessarily the top
  1655.                              window.
  1656.      SHADOWLEFT      0x0004  (Bit 2) Places a shadow on the left side.
  1657.      SHADOWRIGHT     0x0008  (Bit 3) Places a shadow on the right side.
  1658.      ZOOMMODE        0x0010  (Bit 4) Creates a zoom effect with makewindow,
  1659.                              showwindow, and accesswindow.
  1660.      HIDDENMODE      0x0020  (Bit 5) Creates the window as hidden.
  1661.      VIRTUALMODE     0x0040  (Bit 6) Creates a virtual window with a virtual
  1662.                              screen.
  1663.      CURSOROFFMODE   0x0080  (Bit 7) Always leaves cursor off.
  1664.      SEETHRUMODE     0x0100  (Bit 8) Doesn't clear screen inside the border
  1665.                              and ignores ZOOMMODE.
  1666.      NOHIDEMODE      0x0200  (Bit 9) Ignores request to hide window.
  1667.      NOACCESSMODE    0x0400  (Bit 10) Ignores request to access window.
  1668.      NOMOVEMODE      0x0800  (Bit 11) Ignores request to move/resize window.
  1669.      TOCRTMODE       0x1000  (Bit 12) Indicates writing to CRT.
  1670.      TOHIDDENMODE    0x2000  (Bit 13) Indicates writing to hidden window.
  1671.      TOVIRTUALMODE   0x4000  (Bit 14) Indicates writing to virtual screen.
  1672.  
  1673.  
  1674.    STATIC VARIABLES
  1675.  
  1676.    Static Variables - Finally, the variables used in WNDWC can be described in
  1677.    detail and can be accessed by the user.
  1678.  
  1679.    Window Flags - While writing to a window, it is difficult to try to analyze
  1680.    the bits in wsmodes to figure out its modes.  So, each mode has been given
  1681.    a corresponding flag.  These flags are set for the current window.  Though
  1682.    rather intuitive, each of the flag variables is listed below with its
  1683.    corresponding mode:
  1684.  
  1685.  
  1686.    Chapter 3, Data Structure                                           Page 28
  1687.    WNDWC Multi-level Virtual Windows              Reference Guide, Version 2.0
  1688.  
  1689.  
  1690.  
  1691.      Flag            Mode
  1692.      --------------  --------------
  1693.      relflag         RELMODE
  1694.      permflag        PERMMODE
  1695.      zoomflag        ZOOMMODE
  1696.      hiddenflag      HIDDENMODE
  1697.      virtualflag     VIRTUALMODE
  1698.      cursoroffflag   CURSOROFFMODE
  1699.      seethruflag     SEETHRUMODE
  1700.      nohideflag      NOHIDEMODE
  1701.      noaccessflag    NOACCESSMODE
  1702.      nomoveflag      NOMOVEMODE
  1703.      tocrtflag       TOCRTMODE
  1704.      tohiddenflag    TOHIDDENMODE
  1705.      tovirtualflag   TOVIRTUALMODE
  1706.  
  1707.    Single Page Variables - The following variables are grouped together
  1708.    because they are specific to the current video page being used.  If you do
  1709.    use more than one page, these variables will be swapped with another page.
  1710.  
  1711.      Variable        Description
  1712.      --------------  ---------------------------------------------------------
  1713.      wndwstat        (Type: wndwstats_t)  This is the array for the maximum
  1714.                      number of windows both hidden and shown at one time.
  1715.                      Each structure only uses 52 bytes of static data.
  1716.                      wndwstat[0] is always the record for the initial window.
  1717.  
  1718.      topwndwstat     (Type: macro)  This structure makes it easy to always
  1719.                      access the data for the current window and is always up
  1720.                      to date.  This data will be saved in the correct wndwstat
  1721.                      before accessing another window.  topwndwstat is a macro
  1722.                      defined as tws.
  1723.  
  1724.      tws             (Type: wndwstat_t)  tws is used to actually store the
  1725.                      data, whereas topwndwstat is simply a more elaborate way
  1726.                      of coding it.
  1727.  
  1728.      topvirtualstat  (type: macro)  For virtual windows, in addition to tws,
  1729.                      there is the topvirtualstat for the associated virtual
  1730.                      screen which has its own structure.
  1731.  
  1732.      tvs             (Type: wndwstat_t)  tvs is used to actually store the
  1733.                      data, whereas topvirtualstat is simply a more elaborate
  1734.                      way of coding it.  Keep in mind that when writing direct
  1735.                      to the virtual screen (writetovirtual), tws and tvs are
  1736.                      reversed.  It would then be helpful to think of tvs as
  1737.                      the top VIEW stat, since the view is on the CRT.
  1738.  
  1739.      li              (Type: int)  This is the top Level Index for the top
  1740.                      window currently shown on the CRT.  Windows shown on the
  1741.                      CRT are sequentially stacked from index 0 upward.
  1742.  
  1743.      hli             (Type: int)  This is the Hidden Level Index.  Hidden
  1744.                      windows are stacked from index MAXWINDOW downward.  If
  1745.  
  1746.  
  1747.    Chapter 3, Data Structure                                           Page 29
  1748.    WNDWC Multi-level Virtual Windows              Reference Guide, Version 2.0
  1749.  
  1750.  
  1751.                      there are no hidden windows, hli=MAXWINDOW+1.
  1752.  
  1753.      wi              (Type: int)  For the current Window Index, the program
  1754.                      saves and retrieves the wndwstat from this index whether
  1755.                      it is hidden or shown.  It ranges from 0 to MAXWINDOW.
  1756.                      For hidden windows, wi can range from hli to MAXWINDOW.
  1757.                      For the top window on the CRT, wi=li.  For PERMMODE
  1758.                      windows, it  can be <=li.
  1759.  
  1760.      pli             (Type: char)  This Permanent Level Index keeps track of
  1761.                      the order of the permanent windows on the CRT.  They must
  1762.                      be stacked contiguously as the first ones on the CRT or
  1763.                      else an error message will be displayed.  This value is
  1764.                      <=li.
  1765.  
  1766.      cursordefault   (Type: int)  This is the value saved by setcursordefault
  1767.                      for the cursor mode.  It is just as easy to set it
  1768.                      directly.  When makewindow is used, this is the value
  1769.                      saved for that window.
  1770.  
  1771.      margins         (Type: margin_t)  These margins limit the moving or
  1772.                      resizing of windows for each video page.  This prevents
  1773.                      windows from covering status lines or the like.
  1774.  
  1775.      windowmodes     (Type: int)  This is the value saved by setwindowmodes.
  1776.                      It is best to use the function for this value since it
  1777.                      filters out incompatible modes.
  1778.  
  1779.  
  1780.    Universal Variables - These variables are not specific to any window or
  1781.    video page and are used universally in the program.
  1782.  
  1783.      Variable        Description
  1784.      --------------  ---------------------------------------------------------
  1785.      brdr            (Type: brdr_t array) Contains 14 different border styles
  1786.                      each with 15 border parts.  The data structure enables
  1787.                      you to access parts by index name:
  1788.  
  1789.                        mypart = brdr[ SINGLE_BORDER ][ BRDR_TL ];
  1790.  
  1791. |    prefer_multitask  (Type: char) This boolean defaults to 0 so that would
  1792. |                    ignore any multi-tasking environment.  When set to 1 just
  1793. |                    before initwindow, WNDWC will then use the higher speed
  1794. |                    video buffer (MTVB) if available.
  1795.  
  1796.      shadowchar      (Type: char) This is the character used to produce a
  1797.                      shadow.  It is set to a space.  This may not be desirable
  1798.                      for monochrome monitors which may look better with hatch
  1799.                      characters.
  1800.  
  1801.      shadowcolor     (Type: int) This is the attribute used to produce a
  1802.                      shadow.  It is initially set to BLACK on BLACK.  Any
  1803.                      attribute can be used.
  1804.  
  1805.      titleofs        (Type: int) When writing titles, this offset is used to
  1806.  
  1807.  
  1808.    Chapter 3, Data Structure                                           Page 30
  1809.    WNDWC Multi-level Virtual Windows              Reference Guide, Version 2.0
  1810.  
  1811.  
  1812.                      adjust where the title starts writing.  Left justified
  1813.                      titles start at wcol+titleofs while those right justified
  1814.                      end at wcol2-titleofs.  Center justified titles are not
  1815.                      affected.  The default value is 1.
  1816.  
  1817.      virtualrows     (Type: unsigned char)  This is the row height saved from
  1818.                      setvirtualsize setting the number of rows used in the
  1819.                      virtual screen.  The default value is crt_rows.
  1820.  
  1821.      virtualcols     (Type: unsigned char)  This is the column width saved
  1822.                      from setvirtualsize setting the number of columns used in
  1823.                      the  virtual screen.  The default value is crt_cols.
  1824.  
  1825.      virtualsize     (Type: int)  This is the size in bytes to be reserved for
  1826.                      the virtual screen.  The size is virtualcols *
  1827.                      (virtualrows+2) * 2.  Remember the last two rows are
  1828.                      added for the virtual titles.
  1829.  
  1830.      maxvalidpage    (Type: char)  The program can reserve enough data for all
  1831.                      video pages being addressed with MAXPAGEUSED.  However,
  1832.                      the machine that runs the program must have those pages
  1833.                      available.  This variable additionally limits the pages
  1834.                      that can be addressed.  It is set to the lesser of
  1835.                      max_page or MAXPAGEUSED.
  1836.  
  1837.      zoomdelay       (Type: char)  This value is set by initwindow to control
  1838.                      the zoom rate on non-snowing video cards.  This value is
  1839.                      set according to the cpuid that QWIKC detected.
  1840.  
  1841.  
  1842.    DYNAMIC VARIABLES
  1843.  
  1844.    Dynamic Variables - These variables are allocated to the heap to leave more
  1845.    room for global variables.  The far heap is always used, therefore the Tiny
  1846.    Model is not supported.  The allocations are done in initwindow.
  1847.  
  1848.      Pointer         Description
  1849.      --------------  ---------------------------------------------------------
  1850.      virtualstat     (Type: wndwstat_t far *)  This array of window structures
  1851.                      is for the virtual screens associated with the virtual
  1852.                      windows.  All routines use this data when writing to
  1853.                      virtual screens by copying it to tws.  The index for this
  1854.                      record is obtain from tws.vi.  Since this array is filled
  1855.                      at random, vi does not correspond to wi.  When a virtual
  1856.                      window is removed, these stats are "freed" by setting
  1857.                      wsname to FREEWINDOW - they are not freed by calling
  1858.                      free().  All video pages use this one array.
  1859.  
  1860.      pagestat        (Type: wndwstat_t far *)  If your program uses multiple
  1861.                      video pages, a complete structure containing all the
  1862.                      window records and indexes is saved for each video page.
  1863.                      Any pagestat can be swapped with the top page variables
  1864.                      (the first 10 listed under "Single Page Variables" above)
  1865.                      to work on the current video page.  The writetopage
  1866.                      function handles this operation.
  1867.  
  1868.  
  1869.    Chapter 3, Data Structure                                           Page 31
  1870.    WNDWC Multi-level Virtual Windows              Reference Guide, Version 2.0
  1871.  
  1872.  
  1873.    A P P E N D I X  A :   M E M O R Y   A L L O C A T I O N
  1874.  
  1875.    This section covers the memory requirements for static data in the data
  1876.    segment and dynamic data in the heap.  This will give you the figures on
  1877.    how to calculate the memory needed for your program.
  1878.  
  1879.  
  1880.    GLOBAL MEMORY
  1881.  
  1882.    Global Memory - WNDWC is very frugal with global data.  Here is the
  1883.    breakdown on the fixed amount of data required:
  1884.  
  1885.      Variables                       Bytes
  1886.      ------------------------------- -----
  1887.      Border array                      210
  1888.      Basic windows                     142
  1889.      Additional for virtual windows     69
  1890.      Additional for multi-page video     4
  1891.                                      -----
  1892.      Fixed allocation                  425
  1893.  
  1894.    The additional data space for virtual windows and multi-page video, if not
  1895.    used, can be excluded by undefining the macros.  This is the allocation for
  1896.    MAXWINDOW=0.  For each additional window structure, add 52 bytes.  So, for
  1897.    MAXWINDOW=10, the allocation would be (52*10)+425=945 bytes.
  1898.  
  1899.  
  1900.    DYNAMIC MEMORY
  1901.  
  1902.    Dynamic Variables - To alleviate using global data, dynamic variables are
  1903.    used for permanent and temporary use.  The allocation for virtual screen
  1904.    records and video page records are permanent throughout the program.  Many
  1905.    other procedures such as movewindow temporarily use the heap to perform
  1906.    operations.
  1907.  
  1908.    Permanent Variables - If the macros have been defined, the following
  1909.    allocation can be calculated:
  1910.  
  1911.      Variables       Bytes
  1912.      --------------- -------------------------------
  1913.      virtualstat     52 per virtual window
  1914.      pagestat        (sizeof(pagestat_t)) per video page
  1915.      Virtual screen  virtualsize
  1916.  
  1917.    Virtual screens are kept in memory until removewindow is called.
  1918.  
  1919.    Temporary Variables - For functions that temporarily use the heap, the size
  1920.    of allocation is listed along with each function in section 2 above.
  1921.    Generally, you should allow about the same size as 3 CRT screens of
  1922.    available heap for those functions.  For a video mode with 25 rows and 80
  1923.    columns, this is (80*25*2)*3=12000 bytes, in addition to the random
  1924.    allocation.
  1925.  
  1926.    Random Allocation - Because of the nature of random access to windows and
  1927.    underlays, the program uses farmalloc and farfree.  This means that there
  1928.  
  1929.  
  1930.    Appendix A: Memory Allocation                                       Page 32
  1931.    WNDWC Multi-level Virtual Windows              Reference Guide, Version 2.0
  1932.  
  1933.  
  1934.    are going to be gaps of free memory in the heap.  To account for this, you
  1935.    should more than double the amount of data expected for underlays and
  1936.    virtual screens.  It is up to you to judge just how much of the heap is
  1937.    going to be truly random.  In the case of simple serial-access to windows,
  1938.    the heap will be contiguous and doubling of the heap is unnecessary.
  1939.  
  1940.  
  1941.    CODE SIZE
  1942.  
  1943.    Code Size - WNDWC is also very frugal with code.  Here is the breakdown for
  1944.    code usage in the Small model (this may vary slightly):
  1945.  
  1946.      Code Description                Bytes
  1947.      ------------------------------- -----
  1948.      Basic windows                    9385
  1949.      Additional for virtual windows    742
  1950.      Additional for multi-page video  4049
  1951.                                      -----
  1952.      Total code                      14176
  1953.  
  1954.    Of course the linker will optimize the code leaving out unused functions.
  1955.    But this gives you a good idea of how small the code really is!
  1956.  
  1957.  
  1958.  
  1959.  
  1960.  
  1961.  
  1962.  
  1963.  
  1964.  
  1965.  
  1966.  
  1967.  
  1968.  
  1969.  
  1970.  
  1971.  
  1972.  
  1973.  
  1974.  
  1975.  
  1976.  
  1977.  
  1978.  
  1979.  
  1980.  
  1981.  
  1982.  
  1983.  
  1984.  
  1985.  
  1986.  
  1987.  
  1988.  
  1989.  
  1990.  
  1991.    Appendix A: Memory Allocation                                       Page 33
  1992.    WNDWC Multi-level Virtual Windows              Reference Guide, Version 2.0
  1993.  
  1994.  
  1995.    A P P E N D I X  B :   E R R O R   M E S S A G E S
  1996.  
  1997.    Because WNDWC is so powerful, it writes to screen in memory as well as the
  1998.    CRT.  Should you make a mistake in programming, it may not show up on the
  1999.    CRT screen.  So, to prevent the errors before they happen, programs written
  2000.    with errors will terminate with an error message window on the CRT to
  2001.    reveal the problem.  The program terminates through the GOOF module, which
  2002.    can be freely edited.
  2003.  
  2004.    "Not enough heap space" - There is not enough far heap space.  Too much
  2005.    memory is being taken.  When running under the Turbo C environment in the
  2006.    Small or Medium models, you may get this error if you set your near heap
  2007.    size (_heaplen) to anything very large.  This will cause the near heap to
  2008.    take a greater portion of available memory, leaving a smaller amount for
  2009.    the far heap.  This is disastrous since WNDWC does all allocating on the
  2010.    far heap.
  2011.  
  2012.    "Too many windows" - Tried to create more windows than MAXWINDOW allows.
  2013.    Either remove windows or increase MAXWINDOW.
  2014.  
  2015.    "Too many virtual windows" - Tried to create more virtual windows than
  2016.    MAXVIRTUALWINDOW allows.  Either remove windows or increase
  2017.    MAXVIRTUALWINDOW.
  2018.  
  2019.    "Perm window out of order" - Tried to create a PERMMODE window while a
  2020.    normal window is the top window.  Remove or hide window before making a
  2021.    permanent window.  Routinely, all PERMMODE windows are created first.
  2022.  
  2023.    "No window to remove" - Tried to remove the initial window WINDOW0 which is
  2024.    permanent.
  2025.  
  2026.    "Hidden window not found" - Tried to write to a hidden window that does not
  2027.    exist.  Check for the correct name.
  2028.  
  2029.    "Virtual screen not found" - Tried to write to a virtual screen that does
  2030.    not exist.  Check for the correct name.
  2031.  
  2032.    "Video page not available" - Tried to write to a video page that has not
  2033.    been allocated or does not exist for the hardware as expected.  Be sure to
  2034.    use maxvalidpage.
  2035.  
  2036.  
  2037.  
  2038.  
  2039.  
  2040.  
  2041.  
  2042.  
  2043.  
  2044.  
  2045.  
  2046.  
  2047.  
  2048.  
  2049.  
  2050.  
  2051.  
  2052.    Appendix B: Error Messages                                          Page 34
  2053.